const express = require('express');
const app = express();
const cors = require('cors');
app.use(cors()); // 允许跨域

let currentVersion = '20250720-001';

// 获取版本
app.get('/version', (req, res) => {
    res.json({ version: currentVersion });
});

// 模拟更新接口（上线时可移除）
app.get('/update-version/:ver', (req, res) => {
    currentVersion = req.params.ver;
    res.send(`版本更新为 ${currentVersion}`);
});

app.listen(3000, () => console.log('服务启动 http://localhost:3000'));